package ctx

import (
	"mcode/pkg/query"

	"github.com/gin-gonic/gin"
)

// GetPagination 从上下文获取分页参数
func GetPagination(c *gin.Context) *query.Pagination {
	if value, exists := c.Get("pagination"); exists {
		if p, ok := value.(*query.Pagination); ok {
			return p
		}
	}
	return query.NewPagination(1, 10)
}
